<template>

    <div class="icon"@tap="toDetail">
      <div class="icon-img">
        <img
          class="icon-img-content"
          :src="item.typeIcon">
        <p class="icon-desc">{{item.typeTittle}}</p>
      </div>
    </div>

</template>

<script>
// Use Vuex


export default {
  props:[
    'item',
    'index'
  ],

  methods: {
    toDetail(){
      //跳转页面 +传参
      wx.navigateTo({
        url:'/pages/todetail/main?index='+this.index
      })
      // wx.reLaunch({
      //   url:'/pages/todetail/main?index='+this.index
      // });
      // wx.navigateBack({
      //   url:'/pages/index/index'
      // })
    }

  }
}
</script>

<style>
  .slide-image{
    height: 100%;
    width:100%;
  }
  .icon{
    position: relative;
    width: 150rpx;
    height: 47%;
    float: left;

  }
  .icon-img{
    position: absolute;
    height: 100%;
    width:100%;
    box-sizing: border-box;
    padding: 5px;
  }
  .icon-img-content {
    display: block;
    margin: 0 auto;
    height: 70%;
    width:91%;
  }
  .icon-desc{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1rpx;
    line-height: 26rpx;
    font-size:27rpx;

    text-align: center;

  }
  .icon-wrap{
    height: 90%;
    width: 100%;
    margin:0 auto;
    margin-top:15rpx;
  }




</style>
